﻿using System;
using System.Runtime.Serialization;
using NCMIS.ObjectModel.MetaData;

namespace NCMIS.Produce
{
    /// <summary>
    /// Represents the ACL capabilities of a repository. Use combined with the <see cref="RepositoryCapabilities2"/> class.
    /// If the <see cref="RepositoryCapabilities2.Propagation"/> property is <code>none</code>, ACLs are not supported by
    /// the repository. If capabilityACL is <code>discover</code> or <code>manage</code>, additional information about the
    /// repositories permission model and how changes to ACL are specified by instances of this class.
    /// </summary>
    [DataContract(Namespace = CmisNs.Cmis)]
    public class AclCapability
    {
        /// <summary>
        /// Specifies how non-direct ACEs can be handled by the repository.
        /// </summary>
        [DataMember(Name = "propagation")]
        public AclPropagation Propagation
        {
            get;
            set;
        }

        /// <summary>
        ///  A list with names and descriptions of the supported permissions.
        /// </summary>
        [DataMember(Name = "permissions")]
        public PermissionDefinition[] Permissions
        {
            get;
            set;
        }

        /// <summary>
        /// A list with mappings for the basic CMIS permissions to allowed actions.
        /// </summary>
        [DataMember(Name = "mapping")]
        public PermissionMapping[] Mapping
        {
            get;
            set;
        }
    }
}
